package com.example.lists;

import java.util.*;

/**
 * @author hej
 * @date 2024/10/14 15:13
 */
public class ListUnion {
    public static void main(String[] args) {
        //集合求并集
        Set<String> stringList2_2 =  new HashSet<>(Arrays.asList("a,b,c,d,e,f,g,h".split(",")));
        List<String> stringList_1 =  new ArrayList<>(Arrays.asList("a,b,c,i,j,a".split(",")));

        stringList2_2.removeAll(stringList_1);
        stringList_1.addAll(stringList2_2);
        System.out.println(stringList_1);
    }

}
